<?php
namespace app\index\controller;


use think\Controller;
use think\Db;

class News extends Controller
{
    public function index()
    {
        $list = Db::name('news')->field('title,create_at,origin,type,text')->select();
        foreach ($list as $k => $v) {
            $list[$k]['create_at'] = date('Y-m-d',strtotime($v['create_at']));
        }
        // halt($list);
        return $this->fetch('news/index',[
            'list' => $list
        ]);
    }
}